package com.wy.model;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import com.wy.annotation.Sort;
import com.wy.annotation.Unique;
import com.wy.base.AbstractPager;
import com.wy.valid.ValidEdit;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

@ApiModel("组织机构")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Builder
@Table(name = "ti_org")
public class Org extends AbstractPager {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty("组织机构内部编号")
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NotBlank(groups = ValidEdit.class)
	private String orgId;

	@ApiModelProperty("组织机构简称")
	@Column
	@NotBlank
	private String OrgName;

	@ApiModelProperty("组织机构全称")
	@Column
	@NotBlank
	private String FullName;

	@ApiModelProperty("组织机构代码")
	@Column
	@Unique(hump2Snake = false)
	@NotBlank
	private String OrgCode;

	@ApiModelProperty("父级组织机构")
	@Column
	@NotBlank
	private String ParentID;

	@ApiModelProperty("排序")
	@Column
	@Sort(hump2Snake = false)
	private Integer SortIndex;

	@ApiModelProperty("我也不知道是干嘛的")
	@Column
	private String WebIP;

	@ApiModelProperty("我也不知道是干嘛的")
	@Column
	private String WebPort;
}